package cn.kgc.vue.shiro;

import org.apache.shiro.authc.AuthenticationToken;

import javax.servlet.ServletRequest;

/**
 * @author 课工场
 * @date 2024/7/3
 * @description  自定义token
 */
public class JWTToken implements AuthenticationToken {

    private String token;
    private ServletRequest request;



    public JWTToken(String token,ServletRequest request){
        this.token = token;
        this.request = request;
    }

    // 获取身份信息
    @Override
    public Object getPrincipal() {
        return token;
    }

    // 获取用户凭证 密码
    @Override
    public Object getCredentials() {
        return token;
    }

    public ServletRequest getRequest() {
        return request;
    }

    public void setRequest(ServletRequest request) {
        this.request = request;
    }
}
